home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 573 b | 36 lines | [TEXT/CWIE] |
- // TextMethodOf.h
-
- #ifndef TextMethodOf_h
- #define TextMethodOf_h
-
- #ifndef TextMethod_h
- #include "TextMethod.h"
- #endif
-
- template <class TargetType>
- class TextMethodOf: public TextMethod
- {
- typedef TargetType Target;
- typedef void (Target::*Method)( ConstData );
-
- private:
- Target& target;
- Method method;
-
- public:
- TextMethodOf( Target& theTarget,
- Method theMethod )
- : target( theTarget ),
- method( theMethod )
- {
- Assert( method != 0 );
- }
-
- virtual void operator()( ConstData text )
- {
- (target.*method)( text );
- }
- };
-
- #endif
-